#pragma once
#include <IVtk_Types.hxx>
#include <QWidget>
#include <TopoDS_Shape.hxx>
#include <unordered_set>
#include "QIVtkSelectionPipeline.h"

//class viewWidget;

class OccGeoSelector : public QWidget {
	Q_OBJECT
public:
	OccGeoSelector();
	~OccGeoSelector();

public slots:
	void SelctedShapePipeline(Handle(QIVtkSelectionPipeline) pipeline) {
		emit sentShapePipeline(pipeline);
	}

	void SelectedEdgeShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline) {
		emit sentEdgeShape(subShape,pipeline);
	}

	void SelectedFilletShape(const TopoDS_Shape& shape, Handle(QIVtkSelectionPipeline) pipeline) {
		emit sentFilletShape(shape, pipeline);
	}

	void SelectedStretchSubShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline) {
		emit sentStretchSubShape(subShape, pipeline);
	}

	void SelectedHollowShape(const TopoDS_Shape& shape, Handle(QIVtkSelectionPipeline) pipeline) {
		emit sentHollowShape(shape, pipeline);
	}

	void SelectedRevolSubShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline){
        emit sentRevolSubShape(subShape, pipeline);
	}

	void OnLeftButtonDown(gp_Pnt position) {
		emit leftButtonDown(position);
	}

signals:
	void sentVertex(const TopoDS_Shape& vertex);
	void sentEdgeShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline);
	void sentShapePipeline(Handle(QIVtkSelectionPipeline) pipeline);
	//void sentStretchPipeline(Handle(QIVtkSelectionPipeline) pipeline);
	void sentStretchSubShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline);
	void sentRevolSubShape(const TopoDS_Shape& subShape, Handle(QIVtkSelectionPipeline) pipeline);
	void sentFilletShape(const TopoDS_Shape& shape, Handle(QIVtkSelectionPipeline) pipeline);
	void sentHollowShape(const TopoDS_Shape& shape, Handle(QIVtkSelectionPipeline) pipeline);
	void leftButtonDown(gp_Pnt position);

public:
	virtual bool addSelectedShape(const TopoDS_Shape& shape) = 0;
	virtual bool deleteSelectedShape(const TopoDS_Shape& shape) = 0;
	virtual void clearSelectedShape() = 0;
	std::vector<TopoDS_Shape> getAllSelectedShape() {
		return m_selectedShapes;
	}
	virtual const TopoDS_Shape &getSelectedShape() = 0;
private:
	//viewWidget* ownerWidget = nullptr;
	std::vector<TopoDS_Shape> m_selectedShapes;
};